home *** CD-ROM | disk | FTP | other *** search
- property pinpoint, poutpoint
-
- on birth me
- return me
- end
-
- on mpreparemedium me
- mci("open cdaudio alias drwCDAudio shareable wait")
- set rcstring to the result
- if voidp(rcstring) then
- return -999
- else
- mci("status drwCDAudio mode wait")
- set rcstring to the result
- if (rcstring = "paused") or (rcstring = "stopped") then
- return 0
- else
- if (rcstring = "playing") or (rcstring = "seeking") then
- return 0
- else
- return -1
- end if
- end if
- end if
- end
-
- on mgettrackposition me, atrack
- mci("status drwCDAudio position track " & string(atrack) & " wait")
- return value(the result)
- end
-
- on mgettracklengthprivate me, atrack
- mci("status drwCDAudio length track " & string(atrack) & " wait")
- return value(the result)
- end
-
- on mgettrack me
- mci("status drwCDAudio current track wait")
- return value(the result)
- end
-
- on stepFrame me
- mci("status drwCDAudio mode wait")
- set rcstring to the result
- if (rcstring = "paused") or (rcstring = "stopped") then
- mci("play drwCDAudio from " & string(the pinpoint of me) & " to " & string(the poutpoint of me))
- end if
- end
-
- on minitialize me
- set cc to mpreparemedium(me)
- mci("set drwCDAudio time format milliseconds")
- mci("set drwCDAudio audio left on")
- mci("set drwCDAudio audio right on")
- mci("status drwCDAudio position wait")
- set pos to value(the result)
- set the pinpoint of me to pos
- set the poutpoint of me to pos
- return cc
- end
-
- on mplay me, aninlist, adurationframes
- if not voidp(aninlist) then
- if count(aninlist) > 1 then
- set inframes to getAt(aninlist, 2)
- set inoffset to integer(inframes * 13.33329999999999949)
- else
- set inoffset to 0
- end if
- set track to getAt(aninlist, 1)
- set intrackpos to mgettrackposition(me, track)
- set inpoint to intrackpos + inoffset
- set the pinpoint of me to inpoint
- if voidp(adurationframes) then
- set len to mgettracklengthprivate(me, track)
- set outpoint to intrackpos + len
- else
- set outpoint to inpoint + integer(adurationframes * 13.33329999999999949)
- end if
- set the poutpoint of me to outpoint
- set instring to " from " & inpoint
- else
- set instring to EMPTY
- end if
- mci("play drwCDAudio " & instring & " to " & string(the poutpoint of me))
- return 0
- end
-
- on mcancelloop me
- set i to getOne(the actorList, me)
- if i > 0 then
- deleteAt(the actorList, i)
- end if
- end
-
- on mpause me
- mci("pause drwCDAudio wait")
- return 0 - length(the result)
- end
-
- on mframesleft me
- mci("status drwCDAudio position wait")
- set pos to value(the result)
- return integer((the poutpoint of me - pos) / 13.33329999999999949)
- end
-
- on mplayloop me, aninlist, adurationframes
- set cc to mplay(me, aninlist, adurationframes)
- append(the actorList, me)
- return cc
- end
-
- on mpauseloop me
- mcancelloop(me)
- return mpause(me)
- end
-
- on mreadstatus me
- mci("status drwCDAudio mode wait")
- set rcstring to the result
- if (rcstring = "paused") or (rcstring = "stopped") then
- return 0
- else
- if (rcstring = "playing") or (rcstring = "seeking") then
- return 1
- else
- return -1
- end if
- end if
- end
-
- on mgettracklength me, atrack
- set len to mgettracklengthprivate(me, atrack)
- return integer(len / 13.33329999999999949)
- end
-
- on mdispose me
- mci("close drwCDAudio")
- end
-